#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int GetNumberOfK(int* nums, int numsLen, int k)
{
    if (k > nums[numsLen - 1] || k < nums[0])
    {
        return 0;
    }
    int  left = 0;
    int right = numsLen - 1;
    int bottom = 0;
    int top = 0;
    int mid = 0;
    while (left < right)
    {
        mid = left + (right - left) / 2;
        if (nums[mid] < k)
        {
            left = mid + 1;
        }
        else
        {
            right = mid;
        }
    }
    bottom = left;
    left = 0;
    right = numsLen - 1;
    while (left < right)
    {
        mid = left + (right - left) / 2 + 1;
        if (nums[mid] > k)
        {
            right = mid - 1;
        }
        else
        {
            left = mid;
        }
    }
    top = right;
    return top - bottom + 1;
}
int main()
{
    int arr[] = { 1,2,3,3,3,4,4,4 };
    int n = 0;
    scanf("%d", &n);
    int number = GetNumberOfK(arr, 8, n);
    printf("%d\n", number);
    return 0;
}